home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / SirTommy.dxr / Internal_5_foundation cards.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  1.5 KB  |  56 lines

  1. property spriteNum, row
  2. global stock, foundation, equal, currentsel, getlist, godlist, basecard
  3.  
  4. on beginSprite me
  5.   if listp(foundation) = 0 then
  6.     foundation = [:]
  7.   end if
  8.   row = determinerow()
  9.   foundation.addProp(row, new(script("card pile")))
  10.   basecard = "ace"
  11. end
  12.  
  13. on determinerow me
  14.   if spriteNum = 11 then
  15.     return #fone
  16.   else
  17.     if spriteNum = 12 then
  18.       return #ftwo
  19.     else
  20.       if spriteNum = 13 then
  21.         return #fthree
  22.       else
  23.         if spriteNum = 14 then
  24.           return #ffour
  25.         end if
  26.       end if
  27.     end if
  28.   end if
  29. end
  30.  
  31. on mouseEnter me
  32.   if getlist <> VOID then
  33.     if sprite(spriteNum).member = member("empty", "playing cards") then
  34.       if getlist.getlastcard().rank = basecard then
  35.         equal = 1
  36.         currentsel = spriteNum
  37.         godlist = foundation[row]
  38.       end if
  39.     else
  40.       if sprite(spriteNum).member <> member("empty", "playing cards") then
  41.         if (getlist.getlastcard().rankvalue = (foundation[row].getlastcard().rankvalue + 1)) and (getlist.getlastcard().suit = foundation[row].getlastcard().suit) then
  42.           equal = 1
  43.           currentsel = spriteNum
  44.           godlist = foundation[row]
  45.         else
  46.           if (getlist.getlastcard().rank = "ace") and (foundation[row].getlastcard().rank = "king") and (getlist.getlastcard().suit = foundation[row].getlastcard().suit) then
  47.             equal = 1
  48.             currentsel = spriteNum
  49.             godlist = foundation[row]
  50.           end if
  51.         end if
  52.       end if
  53.     end if
  54.   end if
  55. end
  56.